home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15755 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: Jens M Andreasen <jens-and@dsv.su.se>
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated
  4. Subject: Re: 8 Queens prog help
  5. Date: 21 Apr 1996 12:10:35 -0500
  6. Organization: Digital Solutions
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4ldq6b$5f2@solutions.solon.com>
  10. References: <4l87ud$73u@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13.  
  14. Mike!
  15.  
  16. It seems like your teacher want's you to mimic prolog in C? Tell him that 
  17. this is generally a bad idea! The braindead logic of AI can never compete 
  18. with the inspired mind of a C-programmer (plus a tiny bit of magic ;)
  19.  
  20. The magic part:
  21. ---------------
  22. You wrote that you wanted to start at a random place? Let that be D1. 
  23. This is the natural home that was given to the queen when history was 
  24. young and should not be changed by you!
  25.  
  26. Optimizing for speed:
  27. ---------------------
  28. Observing that at least one of the solutions is symmetric (mirrored 
  29. through the center) you can place two queens on each call to the function 
  30. that also evaluates legality.
  31.  
  32. Eliminating braindamage:
  33. ------------------------
  34. Since the board is quit small we would like to place the queens very 
  35. close together, right? As close as possible would be the move of the 
  36. knight (one up, two to the right).
  37.  
  38. Summing up:
  39. -----------
  40.  
  41. 1) Start at D1
  42. 2) Place two queens symetrically on each call (D1 && E8 , etc)
  43. 3) Try to place the next queens a knights move away. 
  44.  
  45. // Jens M Andreasen
  46.